package pers.gxm.state;

public class DayState implements State{
    private static DayState dayState = new DayState();
    private DayState(){}
    public static DayState getInstance(){
        return dayState;
    }


    @Override
    public void doClock(Context context, int hour) {
        if(hour < 8 || hour > 20){
            context.changeState(NightState.getInstance());
            return;
        }
        if(hour == 12){
            context.changeState(LunchState.getInstance());
        }
    }

    @Override
    public void doUse(Context context) {
        context.recording("使用金库（白天）");
    }

    @Override
    public void doAlarm(Context context) {
        context.callSecurityCenter("按下警铃（白天）");
    }

    @Override
    public void doPhone(Context context) {
        context.callSecurityCenter("拨打电话（白天）");
    }

    @Override
    public String toString() {
        return "[白天]";
    }
}
